<?php
namespace app\model\admin;

use think\Db;

class Page
{
    //获取单页列表
    public function get_page_lists($where,$sort='',$paginate=10)
    {
        $result_lists = Db::name('pages')->where($where)->order($sort)->paginate($paginate);
        return $result_lists;
    }

    //单页详情
    public function page_detail($page_id){
        $result = Db::name('pages')->where('id',$page_id)->find();
        return $result;
    }

    //文章单页
    public function add_page($data){
        $status = Db::name('pages')->insert($data);
        return $status;
    }

    //文章单页
    public function update_page($where,$data){
        $status = Db::name('pages')->where($where)->update($data);
        return $status;
    }

    //文章单页
    public function delete_page($array_id){
        $article_delete = Db::name('pages')->delete($array_id);
         return $article_delete;
    }


}


